d977b33910981a5e9c415df18089b284b24fbff2
[git-annex.git] /
1 [[!comment format=mdwn
2  username="joey"
3  subject="""comment 4"""
4  date="2023-04-25T17:49:23Z"
5  content="""
6 What should enable that new json output for exceptions, 
7 --json-error-messages or a new option like --json-exceptions?
8
9 The risk is that, since this is a new object type, it breaks a json
10 consumer that expects to find a `{"command":...}` object.
11
12 I do think that git-annex should be free to add new fields to existing json
13 objects. But adding a new object type seems considerably more risky.
14 git-annex has never done that before (eg --json-progress outputs the
15 "command" object with updated values).
16
17 I took a look at datalad's parsing of json from git-annex, to see what it might
18 do if it got a new object type unexpectedly. I'm not convinced it wouldn't
19 misbehave. For example, in `datalad/interface/results.py` `annexjson2result`:
20
21     res['status'] = 'ok' if d.get('success', False) is True else 'error'
22
23 Without a "status" field this will yield "error" which could go on to
24 cause unexpected behavior
25
26 So, I think this would need to be a new --json-exceptions option.
27 """]]